package com.fanshuai.lifecycle.aware;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.stereotype.Component;

/**
 * 获取BeanName
 */
@Component
public class DemoBeanName implements BeanNameAware {
    private String name;

    @Override
    public void setBeanName(String s) {
        this.name = s;
        System.out.println("beanname=" + name);
    }

    public String getName() {
        return name;
    }
}
